home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbwiz13.zip / SOURCE.ZIP / ERRLEVEL.ASM < prev    next >
Assembly Source File  |  1992-07-14  |  1KB  |  40 lines

  1. comment #
  2.  
  3.    +----------------------------------------------------------------------+
  4.    |                                                                      |
  5.    |         QBWiz  Copyright (c) 1990-1992  Thomas G. Hanlin III         |
  6.    |                                                                      |
  7.    |                       QuickBasic Access Library                      |
  8.    |                                                                      |
  9.    +----------------------------------------------------------------------+
  10.  
  11. #
  12.  
  13. public  ERRLEVEL
  14.  
  15.  
  16. extrn  B$terminate: byte
  17.  
  18.  
  19.  
  20. .model medium
  21.  
  22. .code
  23.  
  24.  
  25.  
  26. ERRLEVEL      proc                     ; set error level
  27.               mov            bx,sp
  28.               mov            ax,4[bx]
  29.               mov            bx,offset B$terminate
  30.               mov            cx,seg B$terminate
  31.               mov            es,cx
  32.               mov byte ptr   es:-3[bx],0B8h ; store opcode for "MOV AX,immed"
  33.               mov            es:-2[bx],ax   ; store immediate value
  34.               ret            2
  35. ERRLEVEL      endp                     ; set error level
  36.  
  37.  
  38.  
  39.               end
  40.